package component.global.utils
{
	import component.global.ComponentSetting;
	
	import flash.filters.ColorMatrixFilter;
	import flash.filters.DropShadowFilter;
	import flash.filters.GlowFilter;

	public class FilterUtil
	{
		public static const GRAY_MATRIX:String = "gray";
		
		public static function createDropShadowFilter(angle:int, inner:Boolean = false,distance:int = 2,blur:int = 2):DropShadowFilter{
			return new DropShadowFilter(distance,angle,ComponentSetting.SHADOW_COLOR,1,blur,blur,1,1,inner);
		}
		
		public static function createGlowFilter(color:uint,blur:int = 4, inner:Boolean = false):GlowFilter{
			return new GlowFilter(color,1,blur,blur,1,1,inner);
		}
		
		public static function createColorMatrixFilter(color:String):ColorMatrixFilter{
			switch(color){
				case GRAY_MATRIX:
					return new ColorMatrixFilter([1,0,0,0,-25,0,1,0,0,-25,0,0,1,0,-25,0,0,0,1,0]);
					break;
				default:
					return new ColorMatrixFilter([1,0,0,0,-25,0,1,0,0,-25,0,0,1,0,-25,0,0,0,1,0]);
					break;
			}
		}
	}
}